package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GlVoucherMapper;
import com.ruoyi.system.domain.GlVoucher;
import com.ruoyi.system.service.IGlVoucherService;
import com.ruoyi.common.core.text.Convert;

/**
 * 凭证主表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-15
 */
@Service
public class GlVoucherServiceImpl implements IGlVoucherService 
{
    @Autowired
    private GlVoucherMapper glVoucherMapper;

    /**
     * 查询凭证主表
     * 
     * @param pkVoucher 凭证主表主键
     * @return 凭证主表
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public GlVoucher selectGlVoucherByPkVoucher(String pkVoucher)
    {
        return glVoucherMapper.selectGlVoucherByPkVoucher(pkVoucher);
    }

    /**
     * 查询凭证主表列表
     * 
     * @param glVoucher 凭证主表
     * @return 凭证主表
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<GlVoucher> selectGlVoucherList(GlVoucher glVoucher)
    {
        return glVoucherMapper.selectGlVoucherList(glVoucher);
    }

    /**
     * 查询期初凭证主表列表
     *
     * @param glVoucher 凭证主表
     * @return 期初凭证主表集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<GlVoucher> selectGlVoucherQcList(GlVoucher glVoucher)
    {
        return glVoucherMapper.selectGlVoucherQcList(glVoucher);
    }

    /**
     * 新增凭证主表
     * 
     * @param glVoucher 凭证主表
     * @return 结果
     */
    @Override
    public int insertGlVoucher(GlVoucher glVoucher)
    {
        return glVoucherMapper.insertGlVoucher(glVoucher);
    }

    /**
     * 修改凭证主表
     * 
     * @param glVoucher 凭证主表
     * @return 结果
     */
    @Override
    public int updateGlVoucher(GlVoucher glVoucher)
    {
        return glVoucherMapper.updateGlVoucher(glVoucher);
    }

    /**
     * 批量删除凭证主表
     * 
     * @param pkVouchers 需要删除的凭证主表主键
     * @return 结果
     */
    @Override
    public int deleteGlVoucherByPkVouchers(String pkVouchers)
    {
        return glVoucherMapper.deleteGlVoucherByPkVouchers(Convert.toStrArray(pkVouchers));
    }

    /**
     * 删除凭证主表信息
     * 
     * @param pkVoucher 凭证主表主键
     * @return 结果
     */
    @Override
    public int deleteGlVoucherByPkVoucher(String pkVoucher)
    {
        return glVoucherMapper.deleteGlVoucherByPkVoucher(pkVoucher);
    }
}
